import { getToken } from "@/utils/login-token";
import { getUserKey, setUserKey } from "@/utils/user-key";
import uuidV1 from "uuid/v1"

export function getId() {
  let id = null
  if(getToken() !== null){
    id = getToken()
  }else{
    if(getUserKey() === null){
      setUserKey(uuidV1())
    }
    id = getUserKey()
  }
  return id
}
